/*
 * @Author: mikey.zhaopeng 
 * @Date: 2018-12-16 22:05:07 
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2018-12-16 22:44:31
 */
import 'package:flutter/material.dart';

class SearchBar extends StatelessWidget{
  final String placeHolder;
  final bool enabled;
  final Function onSubmitted;

  const SearchBar({
    Key key,
    this.placeHolder ="搜索美剧/日剧/电影",
    this.enabled = true,
    this.onSubmitted
  }):super(key:key);

  @override
  Widget build(BuildContext context){
    return Container(
      height: 40.0,
      alignment: Alignment.center,
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.all(Radius.circular(5.0))
      ),
      child: TextField(
        enabled: enabled,
        textAlign: TextAlign.start,
        decoration: InputDecoration(
          prefixIcon: Icon(Icons.search),
          hintText: placeHolder,
          border: InputBorder.none
        ),
        onSubmitted: onSubmitted,
      ),
    );
  }
}